package com.tz.colawallet.ui.biz;


import android.content.Context;

import com.tz.colawallet.basecode.base.BaseBiz;
import com.tz.colawallet.basecode.base.BaseRespNew;
import com.tz.colawallet.basecode.comm.BaseSubscribe2New;
import com.tz.colawallet.basecode.comm.RetrofitHelpNew;

import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;

/**
 * Created by Administrator on 2017/10/21.
 */

public class ABiz extends BaseBiz {

    public void login(Context context, String tel, String password, final BaseBiz.Callback<BaseRespNew> callback) {
        com.add(RetrofitHelpNew.getSecretApi(context).login(tel, password)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseSubscribe2New<BaseRespNew>() {

                    @Override
                    public void onSuccess(Object obj) {
                        callback.onSuccess((BaseRespNew) obj);
                    }

                    @Override
                    public void onFailure(Object obj) {
                        callback.onFailure((BaseRespNew) obj);
                    }
                })
        );
    }

}
